package com.liqi.system.domain;

import com.liqi.common.annotation.Excel;
import com.liqi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * 行政区域管理对象 sys_region
 * 
 * @author ymh
 * @date 2022-02-21
 */
@Data
public class SysRegion extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    @Excel(name = "地区ID",sort = 3)
    /** 地区ID */
    private String id;

    /** 行政区域代码 */
    @Excel(name = "行政区域代码",sort = 1)
    private Long code;

    /** 名称 */
    @Excel(name = "名称",sort = 2)
    private String name;


    /** 1是正常，2失效 */
    private Long status;

    /** 父区域id    */
    @Excel(name = "父区域id",sort = 4)
    private Long parentId;

    /** 区域祖级列表 */
    @Excel(name = "区域祖级列表",sort = 5)
    private String ancestors;


    /** 子部门 */
    private List<SysRegion> children = new ArrayList<SysRegion>();

    public void setId(String id) 
    {
        this.id = id;
    }

    public String getId() 
    {
        return id;
    }
    public void setCode(Long code) 
    {
        this.code = code;
    }

    public Long getCode() 
    {
        return code;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }

    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }
    public void setParentId(Long parentId) 
    {
        this.parentId = parentId;
    }

    public Long getParentId() 
    {
        return parentId;
    }
    public void setAncestors(String ancestors) 
    {
        this.ancestors = ancestors;
    }

    public String getAncestors() 
    {
        return ancestors;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("code", getCode())
            .append("name", getName())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("parentId", getParentId())
            .append("ancestors", getAncestors())
            .toString();
    }
}
